package com.sxj.corejava.code10_异常;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @author 石小俊
 */
public class Test06_异常的定位与解决 {

    public static void main(String[] args) throws DateConverException {
        AA a = new AA();
        a.a();
    }

}

class AA {
    public void a() throws DateConverException {
        BB b = new BB();
        b.b();
    }
}

class BB {
    public void b() throws DateConverException {
        CC c = new CC();
        try {
            c.c();
        } catch (ParseException e) {
            e.printStackTrace();
            throw new DateConverException("日期格式有误,该日期的格式必须为:yyyy-MM-dd");
        }
    }
}

class CC {
    public void c() throws ParseException {
        for (int i = 0; i < 4; i++) {
            int j = i / (i - 3);
        }
        System.out.println("循环结束");
//        new SimpleDateFormat("yyyy-MM-dd").parse("12");
    }
}
